package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

/**
 * 应收表Mapper接口
 * 
 * @author zhangjun
 * @date 2020-02-14
 */
@Repository
public interface AlpYingshouMapper 
{
    /**
     * 查询应收表
     * 
     * @param id 应收表ID
     * @return 应收表
     */
    public AlpYingshou selectAlpYingshouById(Long id);

    /**
     * 查询应收表列表
     * 
     * @param alpYingshou 应收表
     * @return 应收表集合
     */
    public List<AlpYingshou> selectAlpYingshouList(AlpYingshou alpYingshou);

    /**
     * 新增应收表
     * 
     * @param alpYingshou 应收表
     * @return 结果
     */
    public int insertAlpYingshou(AlpYingshou alpYingshou);

    /**
     * 修改应收表
     * 
     * @param alpYingshou 应收表
     * @return 结果
     */
    public int updateAlpYingshou(AlpYingshou alpYingshou);

    /**
     * 删除应收表
     * 
     * @param id 应收表ID
     * @return 结果
     */
    public int deleteAlpYingshouById(Long id);

    /**
     * 批量删除应收表
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteAlpYingshouByIds(String[] ids);

    public List<AlpShowActual> showActualState();

    //年度  预测总值、预算总值、实际总值
    public BigDecimal calcYearSumBudget(Integer num);

    public BigDecimal calcYearSumPredict(Integer num);

    public BigDecimal calcYearSumActual(Integer num);

    //季度  预测总值、预算总值、实际总值
    public BigDecimal calcQuarterSumBudget(Integer num);

    public BigDecimal calcEffQuarterSumPredict(Integer num);
    public BigDecimal calcQuarterSumPredict(Integer num);

    public BigDecimal calcQuarterSumActual(Integer num);

    //月度  预测总值、预算总值、实际总值
    public BigDecimal calcMonthSumBudget(Integer num);

    public BigDecimal calcMonthSumPredict(Integer num);
    public BigDecimal calcEffMonthSumPredict(Integer num);

    public BigDecimal calcMonthSumActual(Integer num);

    //周度  预测总值、预算总值、实际总值
    public BigDecimal calcWeekSumBudget(Integer num);

    public BigDecimal calcEffWeekSumPredict(Integer num);
    public BigDecimal calcWeekSumPredict(Integer num);

    public BigDecimal calcWeekSumActual(Integer num);

    public List<EveryOneBooking> everyoneSumBooking();


    //计算合同相关金额和数量
    public List<ContractSheet> calcContractSheet();

    //计算逾期合同
    public List<OverDueContract> calcOverDueContract();

    //应收金额合同明细
    List<HashMap> receivablesContractDetail(AlpContractDetail alpContractDetail);

    //执行中合同明细
    List<HashMap> incompleteContractDetail(AlpContractDetail alpContractDetail);

    //逾期合同明细
    List<HashMap> overdueContractDetail(AlpContractDetail alpContractDetail);

    //应收金额合同明细-阶段列表
    List<HashMap> receivablesStageList(Long contractId);

    //导出月度  核对数据用
    public BigDecimal calcEachMonthSumBudget(@Param("month")Integer month, @Param("contractId")Long contractId, @Param("year")Integer year);
    public BigDecimal calcEachMonthSumPredict(@Param("month")Integer month, @Param("contractId")Long contractId, @Param("year")Integer year);
    public BigDecimal calcEachMonthSumActual(@Param("month")Integer month, @Param("contractId")Long contractId, @Param("year")Integer year);

    //导出周度  核对数据用
    public BigDecimal calcEachWeekSumBudget(@Param("week")Integer week, @Param("contractId")Long contractId, @Param("year")Integer year);
    public BigDecimal calcEachWeekSumPredict(@Param("week")Integer week, @Param("contractId")Long contractId, @Param("year")Integer year);
    public BigDecimal calcEachWeekSumActual(@Param("week")Integer week, @Param("contractId")Long contractId, @Param("year")Integer year);
}
